<template>
    <div>
        <van-nav-bar title="详情" left-text="返回" left-arrow @click-left="onClickLeft" />
       <div v-html="wch.goods_introduce"></div>
       <van-action-bar>
  <van-action-bar-icon icon="chat-o" text="客服" color="#ee0a24" />
  <van-action-bar-icon icon="cart-o" text="购物车" />
  <van-action-bar-icon icon="star" text="已收藏" color="#ff5000" />
  <van-action-bar-button type="warning" text="加入购物车" @click="po" />
  <van-action-bar-button type="danger" text="立即购买" />
</van-action-bar>
    </div>
</template>

<script setup>
import {detailApi} from '@/api/api'
import {ref} from 'vue'
import { useRoute,useRouter } from 'vue-router'
let wch=ref([])
let route=new useRoute()
let router=new useRouter()
detailApi(route.params.goods_id).then(res=>{
    console.log(res)
    wch.value=res.data.message
})
import { useCounterStore } from '@/stores/counter'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
 const po=()=>{
    store.all(wch,route.params.goods_id)
router.push('/gwc')
 }
</script>

<style lang="scss" scoped></style>